<template>
<div style="position: revert">
  <hander/>
  <sidebar/>
  <div style="position: absolute;top: 60px;left: 200px">
    <wxj :data="data"/>
  </div>
  <div style="position:absolute;top: 60px;right: 80px">
    <p>账号：<input type="text" style="width: 70px;height: 20px">
        姓名 <input type="text" style="width: 70px;height: 20px">
      手机号：<input type="text" style="width: 70px;height: 20px">
      <van-button>查询</van-button>
      <van-button>重置</van-button>
  </p>
    <p>
      <van-button style="background-color: cornflowerblue" @click="this.zt=true">+新增</van-button>
      <van-uploader :after-read="afterRead">
        <van-button icon="plus" type="primary">导入</van-button>
      </van-uploader>
      <van-button @click="up">导出</van-button>
    </p >

  </div>

  <div style="position: absolute;top: 220px;right: 130px">
    <div  v-show="zt" style="background-color: #42b983;">
        <van-field  label="用户账号" v-model="form.username"/>
      部门:<select v-model="form.comany_id">
        <option v-for="i in bumen" :key="i.id" :value="i.id">{{i.name}}</option>
      </select>
      职务:<select v-model="form.position_id">
        <option v-for="i in juese" :key="i.id" :value="i.id">{{i.name}}</option>
      </select>
        <van-field  label="手机号" v-model="form.mobile"/>
        <van-radio-group v-model="form.gender" direction="horizontal">
          <van-radio name="1">男</van-radio>
          <van-radio name="2">女</van-radio>
        </van-radio-group>
        <van-field  label="用户真实姓名" v-model="form.username"/>
        <van-field  label="工号" v-model="form.jobnum"/>
        <van-field  label="岗位id"/>
        <van-field  label="头像"/>
        <van-field  label="邮箱" v-model="form.email"/>
        <van-field  label="是否是实体"/>
        <van-button @click="add_user">确认</van-button>
        <van-button @click="this.zt=false">关闭</van-button>
      </div>

    <table border="5" cellpadding="18">
      <tr>
        <td><input type="checkbox"></td>
        <td>用户账号</td>
        <td>性别</td>
        <td>手机号</td>
        <td>工号</td>
        <td>邮箱</td>
        <td>是否是实体</td>
      </tr>
      <tr>
        <td><input type="checkbox"></td>
        <td>121</td>
        <td>123</td>
        <td>123</td>
        <td>123</td>
        <td>123</td>
        <td>123</td>
      </tr>

    </table>
  </div>



</div>
</template>

<script>
import maxios from "../../http/axios";
import hander from "@/components/comm/hander";
import sidebar from "@/components/comm/sidebar";
import wxj from "@/components/comm/wxj";

export default {
  name: "user",
  data(){
    return{
      data:[],
      form:{},
      zt:false,
      bumen:[],//部门
      juese:[]//角色
    }
  },
  methods:{
    //获取无限极
    get_fu(){
      maxios('/comantytree','get').then(res=>{
        this.data = res.list
        this.get_bumenlist()
      })
  },
    //获取部门
    get_bumenlist(){
      maxios('/addcomany','get').then(res=>{
        this.bumen = res.list
      })
    },
    //获取角色
    get_jueselist(){
      maxios('/positionM','get').then(res=>{
        this.juese = res.list
      })
    },
    add_user(){

    }
  },
  mounted() {
    this.get_fu()
    this.get_jueselist()

  },
  components:{
    'hander':hander,
    'sidebar':sidebar,
    'wxj':wxj
  },

}
</script>

<style scoped>

</style>